<template>
  <el-container>
    <el-container>
      <el-header>
        <span>平台后台管理</span>
        <template>
          <div v-if="token" class="user-div">
            <!-- <img src="../../assets/mrtx.jpg" alt="" /> -->
            <h3>欢迎你 {{ userName }}</h3>
            <button @click="cancelLogin">退出登录</button>
          </div>
          <div v-else><span @click="login">登录|注册</span></div>
        </template>
      </el-header>
      <el-container>
        <el-aside width="250px">
          <h3 class="menu-h3">导航菜单</h3>

         <el-menu default-active="2" class="el-menu-vertical-demo" :router="true">
            <!-- <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-loading"></i>
                <span>信息管理</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="/system/orders"> 订单管理 </el-menu-item>
                <el-menu-item index="/system/logs"> 日志管理 </el-menu-item>
              </el-menu-item-group>
            </el-submenu>
            <el-submenu index="2">
              <template slot="title">
                <i class="el-icon-menu"></i>
                <span>用户管理</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="/system/tenantsList">用户列表</el-menu-item>
                <el-menu-item index="/system/tenants">用户操作</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
            <el-submenu index="3">
              <template slot="title">
                <i class="el-icon-document"></i>
                <span>信息审核</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="/system/parkingAudit"> 车位审核 </el-menu-item>
                <el-menu-item index="/system/identityAudit"> 身份审核 </el-menu-item>
              </el-menu-item-group>
            </el-submenu>
            <el-submenu index="4">
              <template slot="title">
                <i class="el-icon-paperclip"></i>
                <span>投诉管理</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="4-1">选项1</el-menu-item>
                <el-menu-item index="4-2">选项2</el-menu-item>
              </el-menu-item-group>
            </el-submenu> -->
            <el-submenu index="5">
              <template slot="title">
                <i class="el-icon-setting"></i>
                <span>管理员信息</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="/system/adminsSystem"> 新建管理员 </el-menu-item>
                <el-menu-item index="/system/adminsList">管理员列表</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
          </el-menu>

        </el-aside>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </el-container>
</template>

<script>
import { createNamespacedHelpers } from "vuex";
const { mapActions } = createNamespacedHelpers("admins");
export default {
  data() {
    return {
      token: "",
      userName: "nihao123",
      userLogin: {
        userName: "",
        passWord: "",
      },
    };
  },
  computed: {},
  methods: {
    // ...mapActions(["getAdm"]),
    cancelLogin() {
      this.token = "";
      localStorage.setItem("token", "");
    },
    login() {
      this.token = true;
      localStorage.setItem("token", true);
    },
  },
  mounted() {
    // console.log(Vue);
  },
};
</script>

<style lang="scss">
.el-container {
  height: 100vh;
}

.el-header {
  background-color: #668299;
  color: rgb(255, 255, 255);
  line-height: 60px;
  padding: 0 80px;
  display: flex;
  justify-content: space-between;

  > span {
    font-size: 25px;
    font-weight: 500;
  }
}

.el-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
  line-height: 160px;
}

.el-submenu {
  span {
    font-size: 16px;
  }
}

.menu-h3 {
  height: 20px;
  line-height: 20px;
}

.el-table {
  margin: auto;
}

.cell {
  text-align: center;
}

.el-main {
  line-height: 20px;
}

.user-div {
  height: 100%;
  align-items: center;
  display: flex;

  > img {
    border-radius: 50%;
    height: 85%;
  }

  > h3 {
    font-size: 18px;
    margin-left: 10px;
  }
}
</style>
